<html>
  <body style='font-family: "HelveticaNeue-Light", "Helvetica Neue Light", "Helvetica Neue", Helvetica, Arial, sans-serif;background:#fcfcfc;padding: 1% 0;'>
    <table style="width:100%;max-width:700px;margin:15px auto;font-size:18px;border:solid 1px #e6e6e6;border-radius:12px;display:block;padding:2px 1%;text-decoration:none;background:white;">
      <tr>
        <td style="padding:2%;">
          <%= yield %>
        </td>
      </tr>
      <% if @user && action_name != "magic_link" %>
        <% last_page_view = @user.page_views.last %>
        <% unless last_page_view && last_page_view.created_at > 4.weeks.ago %>
          <tr>
            <td style="padding:2%;text-align:center">
              <div style="padding-bottom:20px;font-weight:bold;">
                Not signed-in on this device?
              </div>
              <a href="<%= new_magic_link_url(email: @user.email) %>" style="display:block;background:<%= Settings::UserExperience.primary_brand_color_hex %>;color:white;padding:12px 4px;border-radius:8px;font-weight:bold;text-decoration:none;">
                Click here to trigger a magic sign-in link
              </a>
            </td>
          </tr>
        <% end %>
        <tr>
          <td style="padding:3% 12% 2% 4%;font-size:18px;line-height:22px;color:#202121">
            <%= signed_up_with(@user).html_safe %>
            <br /><br />
            <div style="font-size:0.78em">
              <% if @unsubscribe %>
                <%= link_to t("mailer.unsubscribe"), email_subscriptions_unsubscribe_url(ut: @unsubscribe), style: "color:#7d7d7d" %> |
                <a href="<%= app_url(user_settings_path(:notifications)) %>" style="color:#7d7d7d"><%= t("mailer.adjust") %></a>
              <% else %>
                <%= t("mailer.adjust_only_html", path: link_to(app_url(user_settings_path(:notifications)), app_url(user_settings_path(:notifications)))) %></a>
              <% end %>
            </div>
          </td>
        </tr>
      <% end %>
    </table>
  </body>
</html>
